package com.quanyue.music.system.mapper;

import com.quanyue.music.domain.entity.RechargeRule;
import com.shzisg.mybatis.mapper.auto.AutoMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RechargeRuleMapper extends AutoMapper<RechargeRule> {

    RechargeRule findOneValid(@Param("id") String id);

    @Select("select * from qy_recharge_rule order by recharge")
    List<RechargeRule> findAllOrderBy();

    @Select("select r.valid_count from qy_share_record r where r.issue_user = #{userId} ")
    Integer findSharCount(@Param("userId") String userId);

    @Select("select u.flow_type from qy_user u where u.id = #{userId}")
    Boolean findFlowByUserId(@Param("userId") String userId);
}
